// const webpack = require("webpack");
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const {CleanWebpackPlugin} = require("clean-webpack-plugin");
const { VueLoaderPlugin } = require('vue-loader');
module.exports = {
    mode: 'development',
    entry: path.join(__dirname, "src/main.js"),
    output: {
        filename: 'bundle.js',
        path: path.join(__dirname, 'dist'),
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                use:["style-loader","css-loader"]
            },
            {
                test:/\.(png|jpg|gif|svg|jpeg)$/i,
                use:[
                    {
                        loader:"url-loader",
                        options:{
                            limit:1024
                        }
                    }
                ]
            },
            {
                test: /\.vue$/,
                loader: 'vue-loader'
              }
        ]
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: path.join(__dirname, "public/index.html"),
            filename: 'index.html'
        }),
        new CleanWebpackPlugin(),
        new VueLoaderPlugin()
    ],
    devServer:{
        static:{
            directory:path.join(__dirname,"public")
        },
        port:8000,
        compress:true,
        client:{
            overlay:true,
        },
        
    },
    devtool: 'inline-source-map'

}
